<?php
if (isset($orders) && count($orders) > 0) {
    ?>
    <h1>Data Agree</h1>
    <table width="400" border="1" class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>Job Order</th>
                <th>Consignee</th>
                <th>Origin</th>
                <th>Shipper</th>
                <th>Via</th>
                <th>Agreed ?</th>
                <th></th>
            </tr>
        </thead>
        <?php
        $i = 0;
        foreach ($orders as $order) {
            $i++;
            if($order->agree == 'Y'){
                $clr = 'green';
            }else {
                $clr = 'red';
            }
            echo "<tr class=\"record\">";
            echo "<td>$i</td>";
            echo "<td>$order->job_order</td>";
            echo "<td>$order->consgnee</td>";
            echo "<td>$order->origin</td>";
            echo "<td>$order->shipper</td>";
            echo "<td>$order->via</td>";
            echo "<td style='text-align: center;'><strong ><a style='color: $clr' href='" . base_url() . "boss/confirms?id_order=$order->id_order&&agree=$order->agree' target='upload_target'>$order->agree</a></strong></td>";
            echo "<td style='text-align: center;'><a href='" . base_url() . "boss/order_detail/$order->id_order' class='fancybox fancybox.iframe input btn btn-primary'>Details</a></td>";
            echo "</tr>";
        }
        ?>
    </table>
    <?php
}
?>